home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbser320.zip / QBSERIAL.DOC < prev    next >
Text File  |  1993-09-07  |  47KB  |  953 lines

  1.  
  2.  
  3.  
  4.  
  5.                                  QBserial version 3.20
  6.  
  7.             Serial I/O Routines for QB 4.x, BC 7.x, VBDOS, & FOSSIL Drivers
  8.  
  9.           This library will provide you with serial I/O communications
  10.           routines for use in QuickBASIC 4.x (with or without PDQ), the
  11.           Microsoft Basic Compiler 7.x Professional Development System, and
  12.           Visual Basic for DOS 1.x. No longer are you forced to use the poor
  13.           communications support provided by QB.  This program will allow you
  14.           to control 8250 and 16450 type communications ports (UARTS) at
  15.           speeds of up to 115200 baud. Communication ports 1 - 4, and non-
  16.           standard addresses are supported. You will no longer have problems
  17.           with the DTR signal. DTR is left in the same state it was in when
  18.           before you called this driver, or it can be controlled by your
  19.           program. The serial driver includes XON/XOFF and CTS/RTS
  20.           handshaking. Serial input is interrupt driven, using any IRQ you
  21.           specify (1 - 15), with incoming XOFF flow control (if enabled), or
  22.           RTS flow control (if enabled) to prevent overrunning the input
  23.           buffer. This is referred to as "Normal" mode. 
  24.  
  25.           This driver also has a mode where it will operate with FOSSIL
  26.           drivers (INT 14h interface). Using FOSSIL mode allows you to use
  27.           virtually any type of communications hardware, since the type of
  28.           hardware accessed is dependant on the FOSSIL driver. This mode
  29.           requires that you have a FOSSIL driver loaded in advance. This is
  30.           referred to as "FOSSIL" mode.
  31.  
  32.           The driver was written with Microsoft's C, and compiled with
  33.           version 6.0a of that compiler. This driver is useable with
  34.           QuickBASIC version 4.x, and Basic Compiler 6.x & 7.x PDS  (With or
  35.           without PDQ), and Visual Basic for DOS version 1.x. Basic Compiler
  36.           1.x, QuickBASIC 2.x, and 3.x are not supported by this driver. The
  37.           reason is that versions of QuickBASIC prior to 4.0 do not support
  38.           the extensive multi-language interface that QB4.x has (via the
  39.           DECLARE statement and Microsoft language extensions). Throughout
  40.           this manual QB will be used to refer to both QuickBASIC, the Basic
  41.           Compilers (6.x & 7.x PDS), and Visual Basic for DOS.
  42.  
  43.           Before the driver can be used, the following INCLUDE statement must
  44.           be added to the beginning of your QB program:
  45.  
  46.           '    $INCLUDE: 'qbserial.dec'
  47.  
  48.           The declarations included by this statement specify all the entry
  49.           points into the serial driver. DO NOT change them or the driver
  50.           will not function.
  51.  
  52.           Refer to the included sample programs SIMPLE.BAS, PCBDOOR.BAS, and
  53.           OFFHOOK.BAS. they use most of the calls described below.
  54.  
  55.  
  56.  
  57.         QBSERIAL User Manual - V 3.20                              Page 1
  58.  
  59.  
  60.           Qbserial has two (2) modes of operation: Normal and FOSSIL. The
  61.           mode you operate in is specified in the OpenComm statement (The
  62.           FOS% parameter). In the following sections, where applicable, each
  63.           parameter will be explained as to how it operates in both Normal
  64.           and FOSSIL mode.
  65.  
  66.                                   Port Initialization
  67.  
  68.           OpenComm Port%, IRQ/Stat%, Wlen%, Parity%, Bits%, Baud&, HS%, FOS%
  69.  
  70.           Parameter:     Port%
  71.  
  72.           Normal:   If the specified port is 1 to 4, the driver opens that
  73.                     port. If you specify the port as ZERO (0) the driver
  74.                     enters "LOCAL" mode. This allows you to call the driver
  75.                     with data, but the driver won't send anything. This is
  76.                     useful when working with "doors". if you specify the port
  77.                     as any other value, QBserial will use that as the base
  78.                     address for the port. This allows you to work with non-
  79.                     standard I/O addresses. Note however that if you open a
  80.                     non-standard port, you must specify an IRQ value from 1
  81.                     to 15 - There is no default IRQ when used in this manner.
  82.  
  83.           FOSSIL:   Unlike normal mode, "port" does not necessarily relate to
  84.                     a specific communications port or address. Using a "1"
  85.                     for a port value does NOT necessarily mean COM1. Also
  86.                     unlike QBserial's normal mode, a value other than 1 - 4
  87.                     does NOT refer to a base address of a UART.
  88.  
  89.                     When using FOSSIL mode, "port" refers to a logical
  90.                     device. Port 0 is the first port of a FOSSIL device
  91.                     driver, Port 1 the second, and so on. When used with
  92.                     drivers such as X00.SYS (assuming you didn't remap the
  93.                     ports), port 0 refers to COM1, and port 1 refers to COM2.
  94.                     This will vary depending on the FOSSIL driver used and
  95.                     the device(s) referenced. In most cases it is determined
  96.                     when the FOSSIL driver is installed through some sort of
  97.                     configuration file (or command line options) that relates
  98.                     the physical devices to logical port numbers. However, in
  99.                     order to make the FOSSIL implementation as compatible as
  100.                     possible with "normal" mode, the port number passed will
  101.                     have a value of ONE (1) subtracted from it before
  102.                     referring to the actual FOSSIL port. Therefore to access
  103.                     the first port (port 0), you pass a 1 as you did with in
  104.                     normal mode. Internally, one (1) is subtracted so that
  105.                     port 0 is referenced. This makes the implementation or
  106.                     normal and FOSSIL modes totally transparent.
  107.  
  108.                     Specifying a value of ZERO (0) for the port puts the
  109.                     driver in "local" mode. This is identical to normal mode.
  110.  
  111.  
  112.  
  113.         QBSERIAL User Manual - V 3.20                              Page 2
  114.  
  115.  
  116.           Parameter:     IRQ/Stat%
  117.  
  118.           Normal:   Specifies which interrupt to use with this port. If the
  119.                     value of IRQ% is ZERO (0), then the default IRQ values
  120.                     are used (COM1 & COM3 use IRQ4, COM2 & COM4 use IRQ3).
  121.                     This is what most applications will use. Specify an IRQ
  122.                     value of 1 through 15 when you want to use an IRQ value
  123.                     other than the default. Such as when you want to use
  124.                     IRQ15 with COM3. NOTE: Be careful when choosing an IRQ
  125.                     value other than the default. Most machines use some of
  126.                     the other IRQ inputs for other machine functions such as
  127.                     the Hard drive and system clock. QBserial DOES NOT chain
  128.                     the interrupt, it takes it over entirely. If you choose
  129.                     an IRQ that is used for something already, your machine
  130.                     will most certainly operate improperly.
  131.  
  132.           FOSSIL:   No IRQ value is necessary in FOSSIL mode since all
  133.                     communications tasks are handled outside of QBserial. The
  134.                     IRQ used with a particular "port" will be determined at
  135.                     the time the FOSSIL driver is installed, probably through
  136.                     the same configuration method mentioned above.
  137.  
  138.                     When using FOSSIL mode, this field is now Status. This is
  139.                     a value RETURNED to the programmer when OpenComm has
  140.                     completed. It indicates whether or not the FOSSIL driver
  141.                     initialized properly and is ready to perform
  142.                     communications tasks. A value of 1954h (HEX) or 6484
  143.                     (DECIMAL) indicates a successful initialization. ANY
  144.                     OTHER value indicates a initialization failure.